/*************************************
 * Created by WebStorm
 * Author : 艾尼亚尔·毛拉吾提
 * QQ : 524155792  WeChat : ainiyar0124
 * Created Time :2025/1/21 15:29
 Desc :
 **************************************/
import {defineStore} from "pinia";
import MaleAvatar from '@assets/images/07.jpg'
import FemaleAvatar from '@assets/images/05.jpg'

type UserState = {

    name: string,
    phone: string,
    avatar: string,
    gender: number,
    county: string,
    auth: number,
    alma_mater: string,
    education: string,
    regional: boolean,

}

export const UseUserStore = defineStore('user', {
    state: (): UserState => ({
        name: '赛买提艾山',
        phone: '15699175460',
        avatar: '',
        gender: 0,
        county: '伊宁市',
        auth: 0,
        alma_mater: '中国北京清华传媒大学',
        education: '硕士',
        regional: false,//是否区代理
    }),
    getters: {
        computedAvatar: (state) => {
            return state.gender === 0 ? MaleAvatar : FemaleAvatar;
        }
    },
    actions: {
        //业务员退出登录
        logOutSalesman() {
            console.log('退出登录')
            return Promise.resolve();
        }
    }
})